Skip to content

Added Enum stubs to make method purity precise #4079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 2.1.x
Choose a base branch
from

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Jul 2, 2025

@zonuexe zonuexe force-pushed the add-enum-stub branch 2 times, most recently from 98a9c9b to 17b4ef2 Compare July 2, 2025 06:39
@zonuexe zonuexe marked this pull request as draft July 2, 2025 06:47
public static function from(int|string $value): static;

/**
* @return ?static
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While debugging with @nsfisis, he pointed out that this DocBlock causes the return value to be a mixed type.

Although it is redundant, in the scope of this PR it makes sense to duplicate the type declarations in the PHPDoc.

@zonuexe zonuexe marked this pull request as ready for review July 4, 2025 14:23
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enums functions are reported as possibly impure
2 participants